import './assets/main.scss'

import { createApp, h } from 'vue'
import { createPinia } from 'pinia'

import App from './App.vue'
import router from './router'

// import { ElMessageBox } from 'element-plus'

// import 'element-plus/theme-chalk/el-message-box.css'
// import ElementPlus from 'element-plus'
// import 'element-plus/dist/index.css'
// import zhCn from 'element-plus/es/locale/lang/zh-cn'
import 'element-plus/theme-chalk/dark/css-vars.css'
import '@/styles/element/dark/css-vars.scss'


import StuDemo1 from './views/study2/StuDemo1.vue'

const vs = import.meta.env.VITE_BASE_PATH
console.log(vs)

const app = createApp(App)
// for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
//     app.component(key, component)
// }
// 定义全局组件 
// 注册全局组件
app.component('Mycomponeten', {
    name: 'Mycomponeten',
    // 自定义渲染
    render(): any {
        // 通用 setupt() 中返回的渲染函数
        return h('div', [
            h('h1', '通过vue的h函数自定义渲染'),
            h('p', '这是setup()自定义函数'),
            h('button', { onClick: () => alert('这是一个按钮') }, '点击')
        ])
    }
}).component('StuDemo1', StuDemo1)

app.directive('focus', (e) => {
    e.focus()
})
// app.use(ElMessageBox)
// app.use(ElementPlus, {
//     locale: zhCn,
// })
app.use(createPinia())
app.use(router)


app.mount('#app')
